from django.db import models
from utils.basemodel import BaseModel
# Create your models here.

class NavModel(BaseModel):
    navname=models.CharField(max_length=50,verbose_name='导航名称')
    position=models.BooleanField(default=True,verbose_name='导航位置')
    link=models.CharField(max_length=200,verbose_name='链接',default=None)
    ishttp=models.BooleanField(default=True,verbose_name='是否是http链接')
    class Meta:
        db_table='nav'
    def __str__(self):
        return self.navname

class BannerModel(BaseModel):
    title = models.CharField(max_length=50, verbose_name='标题')
    imgsrc = models.ImageField(upload_to='uploads', verbose_name='图片')
    link = models.CharField(max_length=200, verbose_name='链接', default='#')
    ishttp = models.BooleanField(default=False, verbose_name='是否是http链接')

    class Meta:
        db_table='dgbanner'
    def __str__(self):
        return self.title